home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / sphigs / sph_srgp.lha / srgp / examples / testpixmap.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-09  |  1.3 KB  |  51 lines

  1. #include "srgp.h"
  2. #include <stdio.h>
  3.  
  4. main()
  5. {
  6.    FILE *f;
  7.  
  8.    SRGP_begin ("Testing pixmap patterns", 800,800,7,FALSE);
  9.    SRGP_enableSynchronous ();
  10.  
  11.    SRGP_loadCommonColor (0, "black");
  12.    SRGP_loadCommonColor (1, "blue");
  13.    SRGP_loadCommonColor (2, "green");
  14.    SRGP_loadCommonColor (3, "cyan");
  15.    SRGP_loadCommonColor (4, "red");
  16.    SRGP_loadCommonColor (5, "magenta");
  17.    SRGP_loadCommonColor (6, "yellow");
  18.    SRGP_loadCommonColor (7, "white");
  19.  
  20.    SRGP_setInputMode (LOCATOR, EVENT);
  21.  
  22.    f = fopen ("pixpatdefs", "r");
  23.    if (SRGP_loadPixmapPatternsFromFile (f)) {
  24.       fprintf (stderr, "SOMETHING BAD HAPPENED.\n"); 
  25.       exit(1);
  26.    }
  27.    fclose(f);
  28.  
  29.    SRGP_setFillPixmapPattern (0);
  30.    SRGP_setFillStyle (PIXMAP_PATTERN);
  31.    SRGP_fillEllipse (SRGP_defRectangle(5,5, 500,200));
  32.    SRGP_waitEvent (INDEFINITE);
  33.  
  34.    f = fopen ("bitpatdefs", "r");
  35.    if (SRGP_loadBitmapPatternsFromFile (f)) {
  36.       fprintf (stderr, "SOMETHING BAD HAPPENED.\n"); 
  37.       exit(1);
  38.    }
  39.    fclose(f);
  40.    SRGP_setFillBitmapPattern (106);
  41.    SRGP_setFillStyle (BITMAP_PATTERN_OPAQUE);
  42.    SRGP_fillEllipse (SRGP_defRectangle(5,5, 500,200));
  43.    SRGP_waitEvent (INDEFINITE);
  44.  
  45.    SRGP_setColor (4);
  46.    SRGP_setFillBitmapPattern (0);
  47.    SRGP_setFillStyle (BITMAP_PATTERN_OPAQUE);
  48.    SRGP_fillEllipse (SRGP_defRectangle(5,5, 500,200));
  49.    SRGP_waitEvent (INDEFINITE);
  50. }
  51.